﻿using System;
using System.Collections;
using System.Drawing;
using System.Collections.Generic;
using System.Text;

namespace LowLevelGraphics
{
    /// <summary>
    /// Color rect sorter
    /// </summary>
    public class ColorRectSort : IComparer<ColorRect>
    {
        #region IComparer<ColorRect> Member

        /// <summary>
        /// compare method
        /// </summary>
        /// <param name="c1"></param>
        /// <param name="c2"></param>
        /// <returns></returns>
        public int Compare(ColorRect c1, ColorRect c2)
        {
            if (c1.Color.ToArgb() > c2.Color.ToArgb())
                return 1;
            else if (c1.Color.ToArgb() < c2.Color.ToArgb())
                return -1;
            else
                return 0;
        }

        #endregion
    }
}
